<template>
	<view class="page-body">
		<u-navbar back-text="返回" 
			title="邀请好友" 
			:border-bottom="false"
			:background="{background:'transparent'}"></u-navbar>
			<view class="bg-white" style="margin-top: -44px;">
				<image :src="baseUrl+img_url" @click="app.showImg(baseUrl+img_url)" style="width: 100%;" mode="widthFix"></image>
			</view>
		<bottomShare :imgFile="baseUrl+img_url" :url="baseUrl+img_url"></bottomShare>
	</view>
</template>


<script>
	import bottomShare from '@/components/bottomShare';
	export default {
		components: {
			bottomShare
		},
		data() {
			return {
				is_wxmp:0, 
				img_url:'',
				baseUrl:this.config.baseUrl
			}
		},
		onLoad(options) {
			this.getImg();
			//微信公众号分享
			let setting = uni.getStorageSync('setting');
			this.handleWxH5.share(this,setting.site_name,'',this.config.baseUrl+setting.logo);
		},
		onShow: function() {},
		computed: {},
		onReady() {
		},
		methods: {
			getImg(){
				//#ifdef MP-WEIXIN
					this.is_wxmp = 1;
				//#endif
				this.$u.post('member/api.users/getShareImg',{isnew:1,is_wxmp:this.is_wxmp}).then(res => {
					this.img_url = res.data.img;
				}).catch(res=>{
					this.app.showModal(res.msg, -1);
				})
			}
		}
	}
</script>

<style lang="scss">
	.bottomShare{
		background: #FFFFFF;
	}
</style>
